using UnityEngine;
using System.Collections;

public class Waypoint : MonoBehaviour {
    // trigger: if an patroling enemy enters switch to next waypoint
    void OnTriggerEnter(Collider collider)
    {
    	PatrolBehaviour behaviour = collider.GetComponent<PatrolBehaviour>();
        if (behaviour != null)
        {
            behaviour.SwitchWaypoint();
        }
    }
}
